<?php
session_start();

$id = (int) $id;
include ("../func/func.php");


if (isset($_SESSION['uin'])&&($row['uin']==48||$row['uin']==2)){
      $res = mysql_unbuffered_query("SELECT geo.uin.uin, geo.mail.t, geo.mail.msg, ".
                         "geo.mail.subj, geo.mail.time, geo.uin.nick ".
                         "FROM geo.mail ".
                         "RIGHT JOIN geo.uin ON geo.uin.uin = geo.mail.fr ".
                         "WHERE geo.mail.id = $id");
      $mail = mysql_fetch_assoc($res);

      $res = mysql_unbuffered_query("SELECT nick FROM geo.uin WHERE uin = '$mail[t]'");
      $nick = mysql_fetch_row($res);
?>
<table border="1" align="center" width="600">
<tr nowrap>
  <td>
   <b>subj:</b> <? echo $mail['subj']; ?>
  </td>
</tr>
<tr nowrap>
  <td>
   <b>from:</b> <? echo $mail['nick']; ?>
  </td>
</tr>
<tr nowrap>
  <td>
   <b>to:</b> <? echo $nick[0]; ?>
  </td>
</tr>
<tr >
  <td>
  </td>
</tr>
<tr >
  <td>
   <? echo $mail['msg']; ?>
  </td>
</tr>

</table>

<div align="center"><form method="post" action="read.php">id:&nbsp;&nbsp;<input type="text" name="id" value="<?php echo $id; ?>"><input type="submit" name="submit" value=">>"></form></div>
<?php
}else {
header ("location: /login.php");
}
?>
